<template>
	<view class="addres-box" :style="{direction:i18nLocale=='ug'?'rtl':''}" @click="changeaddress">
		<u-icon name="map-fill" size="26" color="#45bc1b"></u-icon>
		<view class="items" v-for="(item,index) in topsValue">[ {{i18nLocale=='ug'?item.ug_name:item.cn_name}} ]</view>
	</view>
</template>

<script>
	import {
		Translation,

	} from '@/utils/getAddres.js';
	import {
		getridertops,
	} from '@/api/all.js';
	export default {
		name: "Address",
		data() {
			return {
				selecetAre: []
			};
		},
		computed: {
			topsValue() {
				return this.$store.state.tops;
			},
			i18nLocale() {
				return this.$i18n.locale;
			}
		},
		mounted() {
			// this.getRidertops();
		},
		methods: {
			changeaddress() {
				uni.navigateTo({
					url: '/pages/index/selecetaddress'
				})
			},
			// getRidertops() {
			// 	let that = this;
			// 	getridertops({}).then((res) => {
			// 		if (res.code == 200) {
			// 			that.selecetAre = res.body.data;
			// 		}
			// 	})
			// },
		}
	}
</script>

<style lang="scss" scoped>
	.addres-box {
		width: 100%;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		background-color: $uni-bg-color-box;
		border-radius: $uni-border-radius-base;
		box-shadow: $uni-bg-shadow;
		margin-top: $uni-spacing-margin-sm;
		padding: $uni-spacing-padding-sm;

		.items {
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
			color: $uni-color-title;
			padding: 0rpx 10rpx;
			font-size: $uni-font-size-sm1;
			display: flex;
			align-items: center;
		}

	}
</style>